import Vue from 'vue'
import VueRouter from 'vue-router'
import Film from '../views/Film.vue'
import Cinema from '../views/Cinema.vue'
import News from '../views/News.vue'
import User from '../views/User.vue'
Vue.use(VueRouter)

  const routes = [
  {
	path:"/",
	redirect:"film"  //重定向 上来就渲染Film组件
  },
  {
	path:"/film",
	redirect:"/film/nowPlaying"
  },
  {
    path: '/film/:type',//影片页面
    name: 'film',
    component: Film
  },
  {
    path: '/cinema',//影院页面
    name: 'cinema',
    component:Cinema
  },
  {
	path:'/news',//资讯页面
	component:News,
	meta:{
		flag:true //导航条不可见
	}
  },
  {
	path:'/user',//用户页面
	component:User,
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
